<template>
	<view class="pageBox">
		<image :src="imgUrl" mode="widthFix"></image>
		<view class="btnBox" @click="toHome">
			立即使用
		</view>
		<view style="width: 100%;height: 60rpx;"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type:'',
				id:'',
				info:{},
				imgUrl:''
			}
		},
		onLoad(e){
			var _this=this;
			_this.imgUrl= _this.$baseURL+'/uploads/share_wx.jpg'
			
			if (e.leader_id) {
				_this.updateLeader(e.leader_id);
			}
			
		},
		onShow() {
			var _this=this;
			
		},
		onShareAppMessage(res) {
			return {
				title: '给你推荐一个好用记工记账小程序',
				path: '/pages/index/index?leader_id=' + this.userInfo.id,
				imageUrl: '/static/sharePic.jpg',
			}
		},
		methods: {
			toHome(){
				console.log('wx=============================3')
				uni.redirectTo({
					
					url:'/pages/login/loginWx'
				})
			},
			// 更新推荐人
			updateLeader(leader_id) {
				var _this = this;
				_this.$u.post('/api/plus.leader/bind_leader', {
					leader_id: leader_id
				}).then(res => {
					console.log(res);
				}).catch(res => {
					console.log(res);
				})
			},
			
			
		}
	}
</script>

<style>
	page {
		background-color: #fff;
	}
</style>
<style scoped lang="scss">
	.pageBox{
		position: relative;
	}
	.pageBox image{
		width: 100%;
	}
	
	.downImg{
		position: absolute;
		top: 45%;
		width: 100%;
		height: 100rpx;
	}
	
	.btnBox{
		width: 690rpx;
		height: 90rpx;
		text-align: center;
		line-height: 90rpx;
		background-color: #327fe9;
		color: #fff;
		margin: 40rpx auto;
		border-radius: 10rpx;
	}
</style>
